package cn.zz.comm.types.query;

import cn.zz.comm.core.types.query.PageQuery;

/**
 * @author zhongq
 * @since 2024/4/26
 */
public class BaseQuery {

	public static final int DB_PATTERN_COUNT_AS_ID = -1;
	public static final int DB_PATTERN_ID = -2;
	public static final int DB_PATTERN_BRIEF_FILED = -3;
	public static final int ORDER_BY_ID_ASC = -1;
	public static final int ORDER_BY_ID_DESC = -2;

	public Integer from = 0;
	public Integer size = 1;
	public Integer dbPattern;
	public Integer orderBy;

	public void page(PageQuery page) {
		if (page != null) {
			this.from = (page.getCurrent() - 1) * page.getSize();
			this.size = page.getSize();
		}
	}

}